package com.super8.super8newtv.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/**
 * Time: 2019/2/18
 * Author: ggq
 * Description:
 */
public class AppSettings {
    private static SharedPreferences sharedPreferences;
    private static Context mContext;
    public static final String MAIN_CARD_NO = "MainCardNO";//string
    public static final String CUSTOMER_NAME = "CustomerName";//string
    public static final String Main_AvailableCard_ID = "MainAvailableCardID"; //int

    public static void init(Context context) {
        mContext = context;
        sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
    }

    public String getString(String key) {
        return getString(key, "");
    }

    private static class inner {
        private static final AppSettings instance = new AppSettings();
    }

    public static AppSettings getInstance() {
        return inner.instance;
    }

    public String getString(String key, String value) {
        return sharedPreferences.getString(key, value);
    }
}
